<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class ChangeIndexDelayOrderTaskIdStepCategoryIdInDelayOrderTaskStepCategoryConfirmTable extends AbstractMigration
{
    public function up()
    {
        $this->table('delay_order_task_step_category_confirm')
            ->addIndex(['delay_order_task_id', 'step_category_id'], ['type' => 'normal', 'name' => 'idx_delay_order_task_id_step_category_id'])
            ->removeIndexByName('idx_unique_project_step_category_user')
            ->save();

    }

    public function down()
    {
        $this->table('delay_order_task_step_category_confirm')
            ->addIndex(['delay_order_task_id', 'step_category_id', 'confirm_user_id'], ['type' => 'unique', 'name' => 'idx_unique_project_step_category_user'])
            ->removeIndexByName('idx_delay_order_task_id_step_category_id')
            ->save();
    }
}

